<?php

	// App
	Router::connect('/upload/:controller/:action/*'			, array('layout' => 'ajax', 'isAjax' => true, 'upload' => true));
	Router::connect('/ajax/:controller/:action/*'			, array('layout' => 'ajax', 'isAjax' => true));
	Router::connect('/popup/:controller/:action/*'			, array('layout' => 'popup'));
	Router::connect('/iframe/:controller/:action/*'			, array('layout' => 'iframe'));
	Router::connect('/print/:controller/:action/*'			, array('layout' => 'print'));
	Router::connect('/pdf/:controller/:action/*'			, array('layout' => 'pdf'));
	
	// Dashboard
	Router::connect('/dashboard'							, array('controller' => 'shops', 'action' => 'dashboard_index'));
	Router::connect('/settings'								, array('controller' => 'shops', 'action' => 'dashboard_settings'));
	Router::connect('/settings/theme'						, array('controller' => 'shops', 'action' => 'dashboard_theme'));
	Router::connect('/settings/logo'						, array('controller' => 'shops', 'action' => 'dashboard_logo'));
	Router::connect('/settings/shortcut'					, array('controller' => 'shops', 'action' => 'dashboard_shortcut'));
	Router::connect('/settings/notifications'				, array('controller' => 'shops', 'action' => 'dashboard_notifications'));
	Router::connect('/settings/stats'						, array('controller' => 'shops', 'action' => 'dashboard_stats'));
	
	Router::connect('/orders'								, array('controller' => 'orders', 'action' => 'dashboard_index'));
	
	Router::connect('/stock'								, array('controller' => 'products', 'action' => 'dashboard_index'));
	Router::connect('/stock/details/*'						, array('controller' => 'products', 'action' => 'dashboard_details'));
	Router::connect('/stock/add/*'							, array('controller' => 'products', 'action' => 'dashboard_add'));
	Router::connect('/stock/edit/*'							, array('controller' => 'products', 'action' => 'dashboard_edit'));
	Router::connect('/stock/delete/*'						, array('controller' => 'products', 'action' => 'dashboard_delete'));
	
	Router::connect('/stock/product/preview/delete/*'		, array('controller' => 'products_images', 'action' => 'dashboard_delete'));
	Router::connect('/stock/product/preview/*'				, array('controller' => 'products_images', 'action' => 'dashboard_preview'));

	Router::connect('/categories'							, array('controller' => 'taxonomies', 'action' => 'dashboard_index'));
	Router::connect('/categories/add/*'						, array('controller' => 'taxonomies', 'action' => 'dashboard_add'));
	Router::connect('/categories/edit/*'					, array('controller' => 'taxonomies', 'action' => 'dashboard_edit'));
	Router::connect('/categories/delete/*'					, array('controller' => 'taxonomies', 'action' => 'dashboard_delete'));
	Router::connect('/categories/getByParent/*'				, array('controller' => 'taxonomies', 'action' => 'getByParent'));

	Router::connect('/customers/'							, array('controller' => 'customers', 'action' => 'dashboard_index'));
	Router::connect('/customers/add/*'						, array('controller' => 'customers', 'action' => 'dashboard_add'));
	Router::connect('/customers/edit/*'						, array('controller' => 'customers', 'action' => 'dashboard_edit'));

	Router::connect('/tags/'								, array('controller' => 'tags', 'action' => 'dashboard_index'));
	Router::connect('/tags/add/*'							, array('controller' => 'tags', 'action' => 'dashboard_add'));
	Router::connect('/tags/edit/*'							, array('controller' => 'tags', 'action' => 'dashboard_edit'));
	Router::connect('/tags/delete/*'						, array('controller' => 'tags', 'action' => 'dashboard_delete'));

	Router::connect('/docs/add/*'							, array('controller' => 'posts', 'action' => 'dashboard_add', 'type' => 'pages'));
	Router::connect('/docs/edit/*'							, array('controller' => 'posts', 'action' => 'dashboard_edit', 'type' => 'pages'));
	Router::connect('/docs'									, array('controller' => 'posts', 'action' => 'dashboard_index', 'type' => 'pages'));
	
	Router::connect('/nodes/edit/*'							, array('controller' => 'posts', 'action' => 'dashboard_edit', 'type' => 'blog'));
	Router::connect('/nodes/add/*'							, array('controller' => 'posts', 'action' => 'dashboard_add', 'type' => 'blog'));
	Router::connect('/nodes/comments/*'						, array('controller' => 'posts', 'action' => 'dashboard_comments', 'type' => 'blog'));
	Router::connect('/nodes'								, array('controller' => 'posts', 'action' => 'dashboard_index', 'type' => 'blog'));
	
	Router::connect('/marketing/'							, array('controller' => 'marketing', 'action' => 'dashboard_index'));
	Router::connect('/marketing/edit/*'						, array('controller' => 'marketing', 'action' => 'dashboard_edit'));
	Router::connect('/marketing/add/*'						, array('controller' => 'marketing', 'action' => 'dashboard_add'));
	
	// Shops
	Router::connect('/signup'								, array('controller' => 'customers', 'action' => 'signup'));
	
	Router::connect('/collections/*'						, array('controller' => 'products', 'action' => 'index'));
	Router::connect('/product/*'							, array('controller' => 'products', 'action' => 'details'));

	Router::connect('/archive/*'							, array('controller' => 'posts', 'action' => 'archive'));
	
	Router::connect('/checkout/:order/:action'				, array('controller' => 'checkout', 'action' => 'index'));
	
	Router::connect('/pages/*'								, array('controller' => 'posts', 'action' => 'details', 'type' => 'pages'));
	Router::connect('/pages'								, array('controller' => 'posts', 'action' => 'index', 'type' => 'pages'));
	Router::connect('/blog/:year/:month/:day/*'				, array('controller' => 'posts', 'action' => 'details', 'type' => 'blog', 'year' => '[0-9]+', 'month' => '[0-9]+', 'day' => '[0-9]+'));
	Router::connect('/blog'									, array('controller' => 'posts', 'action' => 'index', 'type' => 'blog'));
	
	Router::connect('/contact'								, array('controller' => 'contact', 'action' => 'index'));

	Router::connect('/'										, array('controller' => 'shops', 'action' => 'index'));
	Router::connect('/:controller'							, array('action' => 'index'));
	Router::connect('/:controller/:action');
	Router::connect('/:controller/:action/*');
	